﻿using BsForApi.Tool;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BsForApi.WX
{
    public class WxbaseApiClass
    {
        /// <summary>
        /// 根据code获取openid
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public static string getWxOpenId(string code)
        {
            var url = "https://api.weixin.qq.com/sns/jscode2session?appid=wx9b6ef8b8dba341cd&secret=97968d60c0b2fe9d68c1f172a99c96c9&js_code=" + code + "&grant_type=authorization_code";

            return Httphelp.RequestUrl(url, "get");
        }
    }
}
